﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Profile;
using System.Data;

namespace WebSite.cn
{
    public partial class bottom : System.Web.UI.UserControl
    {
        // Fields
        public string bottomsg = "";
        public string linkstr = "";

        
        // Methods
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
               // this.Label1.Text = "<a href=http://www.******.com target=_blank>Power by </a>";
                this.Label1.Visible = true;
                string sql = "select * from DB_Link where visible=1 and languages=1 order by linkorder";
                DataTable table = SQLAccess.GreatDs(sql).Tables[0];
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        if (row["linkfile"].ToString() != "")
                        {
                            string linkstr = this.linkstr;
                            this.linkstr = linkstr + "<a href='" + row["linkurl"].ToString() + "' target='_blank'><img src='/uploadfile/link/" + row["linkfile"].ToString() + "' border='0' /></a>  ";
                        }
                        else
                        {
                            string str4 = this.linkstr;
                            this.linkstr = str4 + "<a href='" + row["linkurl"].ToString() + "' target='_blank'>" + row["linkname"].ToString() + "</a>  ";
                        }
                    }
                }
                string str2 = "select classid,classlink,classname from DB_Class where parentid=0 and visible=1 and classname<>'' and (classpcs='底部' or classpcs='顶部和底部') and languages=1 order by classorder";
                DataTable table2 = SQLAccess.GreatDs(str2).Tables[0];
                if (table2.Rows.Count > 0)
                {
                    foreach (DataRow row2 in table2.Rows)
                    {
                        if (row2["classlink"].ToString() != "")
                        {
                            object bottomsg = this.bottomsg;
                            this.bottomsg = string.Concat(new object[] { bottomsg, "<li><a href='", row2["classlink"], "'>", row2["classname"], "</a></li>" });
                        }
                        else
                        {
                            object obj3 = this.bottomsg;
                            this.bottomsg = string.Concat(new object[] { obj3, "<li><a href='content.aspx?cid=", row2["classid"], "'>", row2["classname"], "</a></li>" });
                        }
                    }
                }
            }
        }

        // Properties
        protected global_asax ApplicationInstance
        {
            get
            {
                return (global_asax)this.Context.ApplicationInstance;
            }
        }

        protected DefaultProfile Profile
        {
            get
            {
                return (DefaultProfile)this.Context.Profile;
            }
        }

    }
}